#pragma once

#include <string>
#include <vector>
#include <memory>
#include "onvif_types.h"
#include "soap/soap_message.h"

namespace El {
namespace Onvif {

/**
 * @brief 简化的ONVIF媒体服务实现
 */
class MediaService : public ISoapHandler {
public:
    MediaService();
    virtual ~MediaService() = default;

    // ISoapHandler接口实现
    std::string HandleRequest(const SoapMessage& request, const std::string& remoteAddr) override;

private:
    // 具体的SOAP处理方法
    std::string HandleGetProfiles(const SoapMessage& message);
    std::string HandleGetStreamUri(const SoapMessage& message);
    std::string HandleGetSnapshotUri(const SoapMessage& message);
    std::string HandleGetVideoSources(const SoapMessage& message);

    // 辅助方法
    std::string EscapeXml(const std::string& input) const;
};

} // namespace Onvif
} // namespace El